/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.viajarfacil.DAO;

import java.util.List;

import org.hibernate.criterion.Restrictions;

import com.viajarfacil.entidades.*;

/**
 *
 * @author Luisa
 */
class OfertaHibDAO extends GenericHibDAO<Oferta, Integer> implements OfertaDAO {
	@Override
	public Oferta findByNome(String nome) {
	    List<Oferta> list = findByCriteria(Restrictions.eq("nome", nome));
	    if (list.size() == 1) {
	    	return list.get(0);
	    } else {
	    	return null;
	    }
	}
   
}
